{% load crispy_forms_tags %}
{% load fnschool_tags %}
<div class="pagination d-flex justify-content-center">
  <span class="step-links d-flex justify-content-between align-items-center">
    {% if page_obj.has_previous %}
      <a onclick="set_page(1);" class="pe-2">&lt;&lt;</a>
      <a onclick="set_page({{ page_obj.previous_page_number }});" class="pe-2">&lt;</a>
    {% endif %}
    <span class="current">{{ page_obj.number }}/{{ page_obj.paginator.num_pages }}</span>
    <form method="get" action="" class="form-inline d-flex" name="page_size">
      <input type="number"
             name="page_size"
             id="page_size"
             class="form-control"
             min="1"
             onkeydown="if(event.keyCode==13){set_page_size();return false;}"
             value="{{ page_obj.paginator.per_page }}"
             style="width: 80px;
                    margin: 0 10px" />
      <button type="button" onclick="set_page_size();" class="btn btn-primary">
        &#128640;
      </button>
    </form>
    {% if page_obj.has_next %}
      <a onclick="set_page({{ page_obj.next_page_number }});" class="ps-2">&gt;</a>
      <a onclick="set_page({{ page_obj.paginator.num_pages }});" class="ps-2">&gt;&gt;</a>
    {% endif %}
  </span>
</div>
